{% extends "base.html" %}
{% block title %}Dashboard{% endblock %}
{% block content %}
<div class="row" style="margin-top:30px;">
    <div class="small-3 small-centered columns">
        <h2>
            Attack Stats
        </h2>
    </div>
</div>
<div class="row" style="margin-top:30px;">
    <div class="small-12 small-centered columns">
        <div class="row">
            <div class="small-6 columns">
                <h3>Attacks in the last 24 hours:</h3>
            </div>
            <div class="small-6 pull-1 columns">
                <h3><strong><a href="{{ url_for('ui.get_attacks', hours_ago='24') }}">{{ attackcount | number_format }}</a></strong></h3>
            </div>
        </div>
        <div class="row" style="margin-top:30px;">
            <div class="small-6 columns">
                <h3>TOP 5 Attacker IPs:</h3>
            </div>
        </div>
        <div class="row">
            <div class="small-10 push-2 columns">
                <ol>
                {% for ip in top_attackers %}
                    <li><strong>
                    <img src="{{ get_flag_ip(ip.source_ip) }}" width=25 height=50 />
                    <a href="{{ url_for('ui.get_attacks', source_ip=ip.source_ip) }}">{{ ip.source_ip }} ({{ ip.count | number_format }} attacks)</a>
                    </li></strong>
                {% endfor %}
                </ol>
            </div>
        </div>
        <div class="row" style="margin-top:30px;">
            <div class="small-6 columns">
                <h3>TOP 5 Attacked ports:</h3>
            </div>
        </div>
        <div class="row">
            <div class="small-10 push-2 columns">
                <ol>
                {% for port in top_ports %}
                    <li><strong>
                    <a href="{{ url_for('ui.get_attacks', destination_port=port.destination_port) }}">{{ port.destination_port }} ({{ port.count | number_format }} times)</a>
                    </li></strong>
                {% endfor %}
                </ol>
            </div>
        </div>
        <div class="row" style="margin-top:30px;">
            <div class="small-6 columns">
                <h3>TOP 5 Honey Pots:</h3>
            </div>
        </div>
        <div class="row">
            <div class="small-10 push-2 columns">
                <ol>
                {% for hp in top_hp %}
                    <li><strong>
                    <a href="{{ url_for('ui.get_attacks', honeypot=hp.honeypot) }}">{{ hp.honeypot }} ({{ hp.count | number_format }} attacks)</a>
                    </li></strong>
                {% endfor %}
                </ol>
            </div>
        </div>
        <div class="row" style="margin-top:30px;">
            <div class="small-6 columns">
                <h3>TOP 5 Sensors:</h3>
            </div>
        </div>
        <div class="row">
            <div class="small-10 push-2 columns">
                <ol>
                {% for s in top_sensor %}
                    <li><strong>
                    <a href="{{ url_for('ui.get_attacks', identifier=s.identifier) }}">{{ get_sensor_name(s.identifier) }} ({{ s.count | number_format }} attacks)</a>
                    </li></strong>
                {% endfor %}
                </ol>
            </div>
        </div>
        <div class="row" style="margin-top:30px;">
            <div class="small-6 columns">
                <h3>TOP 5 Attacks Signatures:</h3>
            </div>
        </div>
        <div class="row">
            <div class="small-10 push-2 columns">
                <ol>
                {% for sig in freq_sigs %}
                    <li><strong>
                    <a href="{{ url_for('ui.get_feeds', payload=sig['signature'], channel='snort.alerts') }}">{{ sig['signature'] }} ({{ sig['count'] | number_format }} times)</a>
                    </li></strong>
                {% endfor %}
                </ol>
            </div>
        </div>
    </div>
</div>
{% endblock %}
